﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace csharp_resize
{
    class Program
    {
        static void Main(string[] args)
        {
            String pwd = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
            
            Image image = Image.FromFile(pwd + @"\sample.jpg");

            int width, height;
            width = image.Width;
            height = image.Height;

            Image target = (Image)(new Bitmap(image, new Size((int)(width*0.5), (int)(height*0.5))));
            target.Save(@"convert.png", System.Drawing.Imaging.ImageFormat.Png);
        }
    }
}
